<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- <h1 v-if="awesome">Vue is awesome!</h1> -->
      <!-- v-if和e-else要是并列的兄弟元素 -->
      <!-- <h1 v-else>Oh no 😢</h1> -->

      <!-- template就是一个空的占位标签 -->
      <!-- <template v-if="awesome">
        <div>111</div>
        <div>222</div>
        <div>333</div>
        <div>444</div>
      </template> -->
      <!-- <template v-else>
        <div>555</div>
      </template> -->

      <h1 v-if="num === 1">标题1</h1>
      <h1 v-else-if="num === 2">标题2</h1>
      <h1 v-else>标题3</h1>
    </div>

    <script src="../Vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          awesome: true,
          num: 2,
        },
      });
    </script>
  </body>
</html>
